/*
============================================================================
 Name        : BlockQuote.h
 Author      : \x{738b}\x{658c}
 Version     :
 Copyright   : \x{76ca}\x{76df}\x{8f6f}\x{4ef6}
 Description : CBlockQuote declaration
============================================================================
*/

#ifndef BlockQuote_H
#define BlockQuote_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include "BlockGoods.h"
#include "Flickable.h"
// CLASS DECLARATION

/**
*  CBlockQuote
* 
*/
class CBlockQuote : public CBlockGoods, public MFlickableCallback
{
public:
	~CBlockQuote();

	static CBlockQuote* NewL(CBaseBlock* bsBack);

	static CBlockQuote* NewLC(CBaseBlock* bsBack);

	CBlockQuote(CBaseBlock* bsBack);

public:
	//from CBlock
	void OnDraw(CFbsBitGc& g) const;
	
	void OnKeyDown(TInt keyCode);

	void OnInput(const TDesC8& strInput);
	
	TInt32 GetMenuItem();

	TBool ReadData(const TDesC8& aData);

	void WriteData(TDes8& aBuf);

	TInt GetDataLength();

	TInt16 GetDataType();

	void InitData();

	void ChangeScrollPos(TInt nPos);

	void SizeChanged();
	
	void OnMouseDown(const TPoint& aPt);

	void OnMouseMove(const TPoint& aPt);

	void OnMouseUp(const TPoint& aPt);
	
public:
	// from MFlickableCallback
	virtual TPoint ScrollOffset() const;

	virtual void SetScrollOffset(const TPoint& aOffset);

private:
	TInt GetFieldNum()const;

private:
	void ConstructL();

protected:
	void AddTabs();

public: // from MTabbarObserver
	void HandleTabbarCommand(TInt aCommand);

private:

	TInt m_nStart;
	//TBool m_bFirst;
	TBool m_bIndex;
	TBool m_bIndexData;
	TInt m_psFieldID[38];
	CDesC16Array* m_pstrFieldName;
	TInt m_psIndexID[13];
	CDesC16Array* m_pstrIndexName;
	TInt m_psGZQH_ID[28];
	CDesC16Array* m_psGZQH_Name;
	TInt m_psHK_ID[20];
	CDesC16Array* m_psHK_Name;

	TBool m_bGZQH;
	TBool m_bGZQHData;
	
	TInt iOffset;
	TInt iHeight;
	CFlickable* iFlickable;
	TRect iListRect;

	mutable TInt iStartItem;
	mutable TInt iEndItem;
};

#endif // BlockQuote_H
